/*
 * *******************************************************************
 *   @项目名称: BHex Android
 *   @文件名称: InviteApi.java
 *   @Date: 18-12-25 下午5:51
 *   @Author: ppzhao
 *   @Description:
 *   @Copyright（C）: 2018 BlueHelix Inc.   All rights reserved.
 *   注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的.
 *  *******************************************************************
 */

package io.bhex.sdk.invite;

import io.bhex.baselib.network.BParamsBuilder;
import io.bhex.baselib.network.HttpUtils;
import io.bhex.baselib.network.listener.SimpleResponseListener;
import io.bhex.baselib.network.params.PostParams;
import io.bhex.sdk.Urls;
import io.bhex.sdk.invite.bean.InviteInfoResponse;
import io.bhex.sdk.invite.bean.InviteRelationListResponse;
import io.bhex.sdk.invite.bean.InviteResponse;
import io.bhex.sdk.invite.bean.InviteRewardListResponse;

public class InviteApi {

    /**
     * 获取邀请信息接口
     * @param listener
     */
    public static void getInviteInfo(SimpleResponseListener<InviteInfoResponse> listener){
        PostParams params = BParamsBuilder.post()
                .url(Urls.API_INVITATION_INFO)
                .build();
        HttpUtils.getInstance().request(params,InviteInfoResponse.class,listener);
    }

    /**
     * 获取返佣记录列表
     * @param listener
     */
    public static void getInviteRewardList(String from,int limit,SimpleResponseListener<InviteRewardListResponse> listener){
        PostParams params = BParamsBuilder.post()
                .url(Urls.API_INVITATION_REWARD_LIST)
                .addParam("beforeId",from)
                .addParam("limit",limit)
                .build();
        HttpUtils.getInstance().request(params,InviteRewardListResponse.class,listener);
    }

    /**
     * 获取返佣记录列表
     * @param listener
     */
    public static void getInviteRelationList(String from,int limit,SimpleResponseListener<InviteRelationListResponse> listener){
        PostParams params = BParamsBuilder.post()
                .url(Urls.API_INVITATION_RELATION_LIST)
                .addParam("from_id",from)
                .addParam("limit",limit)
                .build();
        HttpUtils.getInstance().request(params,InviteRelationListResponse.class,listener);
    }

    /**
     * 邀请接口
     * @param listener
     */
    public static void invite(SimpleResponseListener<InviteResponse> listener){
        PostParams params = BParamsBuilder.post()
                .url(Urls.API_INVITATION_SHARE_POSTER)
                .build();
        HttpUtils.getInstance().request(params,InviteResponse.class,listener);
    }

    /**
     * 邀请分享接口信息
     * @param listener
     */
    public static void inviteShareInfo(SimpleResponseListener<InviteResponse> listener){
        PostParams params = BParamsBuilder.post()
                .url(Urls.API_INVITATION_SHARE_POSTER_NEW)
                .build();
        HttpUtils.getInstance().request(params,InviteResponse.class,listener);
    }

}
